<template>
  <div class="fs-4">24小时热门排行榜:</div>

  <ol>
    <li class="mx-2" v-for="rank in notelist" :key="rank.noteId">
      <el-link type="primary">  <!--引入详情页面-->
        <router-link :to="{ path: '/detail/' + rank.noteId }">
          {{ rank.noteName }}
        </router-link>
      </el-link>
    </li>
  </ol>
</template>

<script>
export default {
  name: "HomeRank",
  data() {
    return {
      notelist: [],
    };
  },
  mounted() {
    this.getNoteli();
  },
  methods: {
    getNoteli() {
      this.$axios.get("/api/home/rank").then((response) => {
        this.notelist = response.data;
      });
    },
  },
};
</script>

<style>
</style>